package com.pdwl.cashoutpay.service.imp;

import com.pdwl.cashoutpay.dao.TradeMapper;
import com.pdwl.cashoutpay.entity.Trade;
import com.pdwl.cashoutpay.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImp implements OrderService {

    @Autowired
    TradeMapper orderMapper;

    @Override
    public void add(Trade order) {
        orderMapper.insert(order);
    }

    @Override
    public void update(Trade order) {
        orderMapper.updateByOurOrderId(order);
    }

    @Override
    public Trade findByOurOrderId(String ourOrderId) {

        return orderMapper.findByOurOrderId(ourOrderId);
    }

    @Override
    public Trade findByOrderId(String orderId) {

        return orderMapper.findByOrderId(orderId);
    }
}
